import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue';
import VueRouter from 'vue-router';
import routers from "./router/router";
import 'github-markdown-css/github-markdown.css'
import hljs from 'highlight.js'

Vue.use(ElementUI);

// 自定义vue指令
Vue.directive('highlight', function (el) {
  const blocks = el.querySelectorAll('pre code')
  blocks.forEach(block => {
    hljs.highlightBlock(block)
  })
})

const router=new VueRouter({
  mode:'history',
  routes:routers
})
const bus = new Vue();//新创建一个实例，用以传值
Vue.prototype.bus = bus//挂载在vue的原型上

new Vue({
  el: '#app',
  router,
  render: h => h(App)
});
